<%--
  Created by IntelliJ IDEA.
  User: 瑱彬
  Date: 2015/5/27
  Time: 14:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<% String context = request.getContextPath(); %>
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>博客首页</title>
  <link rel="stylesheet" type="text/css" href="<%=context%>/thirdparts/bootstrap/css/bootstrap.min.css">
  <link rel="stylesheet" type="text/css" href="<%=context%>/thirdparts/bootstrap/css/bootstrap-theme.min.css">
  <link rel="stylesheet" type="text/css" href="<%=context%>/css/common.css"/>
  <link rel="stylesheet" type="text/css" href="<%=context%>/css/right.css"/>
  <link rel="stylesheet" type="text/css" href="<%=context%>/css/content.css"/>
  <script type="text/javascript" src="<%=context%>/js/jquery.min.js"></script>
  <script type="text/javascript" src="<%=context%>/thirdparts/bootstrap/js/bootstrap.min.js"></script>

</head>

<body>
<c:import url="top.jsp">
  <c:param name="pageName" value="home"/>
</c:import>
<div class="center">
  <div class="centerContainer row">
    <div class="leftContainer col-md-9 col-sm-12">
      <div class="BlogContainer">
        <div class="blogHead">
          <span class="blogTitle">${blog.title}</span>
          <span class="blogTime">${blog.addTime}</span>
        </div>
        <div class="blogContent">${blog.content}</div>
        <div class="blogBottom">
          <span class="blogHits">阅读(${blog.hits}) | 评论(${blog.commentCount})</span>
        </div>
      </div>
      <div class="blogNav">
        <c:choose>
          <c:when test="${around.preId != null}"><span class="preBlog"><a href="<%=context%>/content?b=${around.preId}">${around.preTitle}</a></span></c:when>
          <c:otherwise><span class="preBlog">没有了</span></c:otherwise>
        </c:choose>
        <c:choose>
          <c:when test="${around.nextId != null}"><span class="nextBlog"><a href="<%=context%>/content?b=${around.nextId}">${around.nextTitle}</a></span></c:when>
          <c:otherwise><span class="nextBlog">没有了</span></c:otherwise>
        </c:choose>

      </div>

      <div class="CommentContainer">
        <div></div>
      </div>
    </div>
    <div class="rightContainer col-md-3 col-sm-0">
      <div class="rightItem" id="categoryBox">
        <div class="title">文章分类</div>
        <ul class="rlist">
          <c:forEach items="${categorys}" var="cat">
            <li><span class="listTitle"><a href="<%=context%>/category?c=${cat.id}">${cat.name}</a></span><span class="listRight listNum">${cat.blogsum}</span></li>
          </c:forEach>
        </ul>
      </div>
      <div class="rightItem" id="userRecommendBox">
        <div class="title">推荐达人</div>
        <ul class="rlist">
          <c:forEach items="${recommendUsers}" var="user">
            <li class="recommendLi">
              <div class="usericon recommendicon">
                <c:choose>
                  <c:when test="${item.avatar}">
                    <img src="${item.avatar}" alt="">
                  </c:when>
                  <c:otherwise>
                    <img src="images/avatar.jpg" alt="">
                  </c:otherwise>
                </c:choose>
              </div><div class="recommendName"><a href="<%=context%>/userlist?u=${user.id}">${user.name}</a></div>
            </li>
          </c:forEach>

        </ul>
      </div>
      <div class="rightItem" id="articalRecommendBox">
        <div class="title">推荐博文</div>
        <ul class="rlist">
          <c:forEach items="${recommendBlogs}" var="blog">
            <li><span class="listTitle"><a href="<%=context%>/content?b=${blog.id}">${blog.title}</a></span></li>

          </c:forEach>
        </ul>
      </div>

    </div>
  </div>
</div>
<c:import url="bottom.jsp"/>

</body>
</html>
